<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<div id="Content">
    <div class="btnbar">
        <button type="button" class="list" id="gxuser_gw">岗位分配</button>
        <button type="button" class="card" id="gxpublishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
        <button type="button" class="list" id="do_gxpost_next">进入下一步</button>
        <%--<button type="button" class="back" onclick="javascript:history.go(-1);">返 回</button>--%>
    </div>

    <!-- 岗位分配 -->
    <div id="gwpanel" class="condition_cont">
        <form id="thisform1" method="post" action="${path}/Do/GXPost/PostAction">
            <input type="hidden" name="fid" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">选择岗位：</td>
                    <td width="200">
                        <div><input type="hidden" name="jobcode"/><input type="text" name="jobname" class="select"/>
                        </div>
                    </td>
                    <!-- <td width="200"><div><select name="gw" datatype="*" nullmsg="岗位不能为空！">${jobs}</select></div></td> -->
                    <td width="60">
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align:left; letter-spacing:2px;">系统提示：请从下面列表中选择需要分配到所选岗位的人员</td>
                </tr>
                </thead>
            </table>
            <div id="tjusers"></div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="/${fid}/"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td>简历编号:</td>
                    <td>
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td>招聘地区:</td>
                    <td>
                        <div><select name="rcode">
                            <option value="">不限</option>
                            ${regions}</select></div>
                    </td>
                    <td>岗位分配：</td>
                    <td colspan="3">
                        <div>
                            <select name="gwstate">
                                <option value="">全部</option>
                                <option value="已分配">已分配</option>
                                <option value="未分配">未分配</option>
                            </select>
                        </div>
                    </td>
                    <td>是否放弃:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>姓名:</td>
                    <td>
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td>毕业院校:</td>
                    <td>
                        <div><input type="text" name="university"/></div>
                    </td>
                    <td>所学专业:</td>
                    <td colspan="3">
                        <div><input type="text" name="majorname"/></div>
                    </td>
                    <td>最高学历:</td>
                    <td colspan="3">
                        <div><select name="education">
                            <option value="">不限</option>
                            ${education}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td width="80">民族:</td>
                    <td width="150">
                        <div><select name="mzcode">
                            <option value="">不限</option>
                            ${minzu}</select></div>
                    </td>
                    <td width="80">政治面貌:</td>
                    <td width="150">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td width="70" style="text-align:right;">年龄:</td>
                    <td width="60">
                        <div><input type="text" name="agefrom"/></div>
                    </td>
                    <td width="16" style="text-align:center;">至</td>
                    <td width="60">
                        <div><input type="text" name="ageto"/></div>
                    </td>
                    <td width="70" style="text-align:right;">身高:</td>
                    <td width="50">
                        <div><input type="text" name="heightfrom"/></div>
                    </td>
                    <td width="36" style="text-align:center;">至</td>
                    <td width="50">
                        <div><input type="text" name="heightto"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td>身份证号:</td>
                    <td>
                        <div><input type="text" name="cardno"/></div>
                    </td>
                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td colspan="4"></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="12">
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td>
                        <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>
    <table class="treeTable" id="tablelist">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="30">序号</td>
            <td width="60">简历编号</td>
            <td width="50">姓名</td>
            <td width="30">性别</td>
            <!-- <td width="80">生源地</td> -->
            <td width="200">毕业院校</td>
            <td width="120">所学专业</td>
            <td width="80">学历</td>
            <td width="80">联系电话</td>
            <td width="80">面试成绩</td>
            <td>岗位分配</td>
            <td width="50">公布结果</td>
            <td width="50"></td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page"></div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        getList();
        $('#searchbtn').click(function () {
            getList();
        });

        $('#savebtn').click(function () {
            $('#okbtn').click();
        });

        $('input[name=jobname]').click(function () {
            openLayer('选择岗位', '${path}/Do/AssignPosition/index', '90%', '90%');
        });

        //岗位分配
        $('#gxuser_gw').click(function () {
            $('#gwpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
        });

        //全选当页
        $(document).delegate('.allcheckbox', 'click', function () {
            $('#tjusers').html('');
            $(this).parent().parent().parent().next().find('input[type=checkbox]').each(function () {
                if ($(this).is(":checked")) {
                    $('#tjusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                }
            });
        });
        //选择一条
        $(document).delegate('#tablelist tbody tr', 'click', function () {
            var ck = $(this).find('input[type=checkbox]');
            if (ck.is(":checked")) {
                $('#tjusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
            } else {
                $('#tjusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
            }
        });


        $('#do_gxpost_next').click(function () {
            layer.confirm('只有分配了岗位的人员才能执行此操作。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                DelInfo('/Do/GXPost/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}');
                layer.closeAll();
            }, function () {
                layer.closeAll();
            });
        });

    });

    function getList() {
        $('.page').myPagination({
            cssStyle: "pagination",
            showTitle:true,
            rowNumber:true,
            ajax: {
                on: true,
                url: '${path}/Do/GXPost/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                }
            }
        });
    }
</script>
</body>
</html>